package org.sport.dbInterface;

import org.sport.model.entityModel.GrouptableEntity;
import org.sport.model.entityModel.HistoryinfotableEntity;
import org.sport.model.entityModel.UsertableEntity;

import java.util.List;

/**
 * Created by Allen on 2017/9/20.
 */
public interface HisInfoOperation {

    /*
    * 增
    * */
    boolean         addOneCheatInfo(HistoryinfotableEntity historyinfotableEntity);

    /*
    * 改
    * */
//    boolean         update(HistoryinfotableEntity historyinfotableEntity);
    /*
    * 删
    * */
    boolean         delOneCheatInfo(HistoryinfotableEntity historyinfotableEntity);

    /*
    * 查
    * */
    HistoryinfotableEntity findOne(HistoryinfotableEntity historyinfotableEntity);


    /**
     * 返回所有信息
     * @return
     */
    List<HistoryinfotableEntity> findAllHisInfo();

    /**
     * 返回单个联系人的聊天信息
     * @param who
     * @param toWho
     * @return
     */
    List<HistoryinfotableEntity> findAllHisInfoByWho2Who(UsertableEntity who, UsertableEntity toWho);


    /**
     * 返回一个人的所有聊天信息
     * @param who
     * @return
     */
    List<HistoryinfotableEntity> findAllHisInfoByWho(UsertableEntity who);

    /**
     * 返回单个群的 聊天信息
     * @param grouptableEntity
     * @return
     */
    List<HistoryinfotableEntity> findAllHisInfoByGroupId(GrouptableEntity grouptableEntity);

}
